<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
    <head> 
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
    <script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script> 
	// 检索方法
	function searchListForm() {
		var params = $("#searchForm").serialize();
		$("#activity_pane").showLoading();
		$.post("${ctx}/bigcargo/consumption/searchList",params,function(result) {
					var listHtml = result["bigConsumption"];
					var pageHtml = result["page"];
					$("#listHtml").html(listHtml);
					$("#paging").html(pageHtml);
					$("#activity_pane").hideLoading();
				}, 'json');
	}
	 
	$(function(){
		    searchListForm();
		
            $(".tabBox ul li").each(function(){
                var index=$(this).index();

                $(".tabBox ul li").eq(0).addClass("active");

                $(this).click(function(){                  
                    $(this).addClass("active").siblings().removeClass("active");
					
                    $("#tabPageStatus").val($(this).val());
                    searchListForm();
                    
					var tableW = $(".tabBoxSm > .tabSm").eq(index).find('.tableHead').width();
					var tabodyH = $(".tabBoxSm > .tabSm").eq(index).find('.tableBody').height();
					var tableScrollH = $(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').height();
					if(tabodyH>tableScrollH){
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width',tableW + 18 + 'px')
					}else{
						$(".tabBoxSm > .tabSm").eq(index).find('.tableScroll').css('width','inherit')
					}
                })
            })
        })


	//重置
	function clean() {
		$("select").val("");
		searchListForm();
	} 

    </script>
</head>
<body>
<form id="searchForm" method="post">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
                <!-- 单耗号 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="bigConsumption_unitCostNo" /></p>
                    <input class="w-styleNub" id="unitCostNo" name="unitCostNo">
                </div>
                <!-- 款号 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="bigConsumption_styleNo" /></p>
                    <input class="w-styleNub" id="styleNo" name="styleNo">
                </div>
                <!-- 款式名称 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="bigConsumption_styleNameCn" /></p>
                    <input class="w-customer" id="styleNameCn" name="styleNameCn">
                </div>
               
                <!-- 日期 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="bigConsumption_date" /></p>
                    <div class="timeBox">
                        <input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"	id="dateFrom" name="dateFrom" style="width: 110px">
						<p class="list">~</p>
						<input type="text" class="laydate-icon" id="dateTo" name="dateTo" style="width: 110px" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})">
                    </div>        
                </div>
                <%-- <!-- 业务员 -->
                <div class="searchInp clearfix">
                    <p><spring:message code="bigConsumption_salesman" /></p>
                    <input class="w-salesman" id="userId" name="userId">
                </div> --%>
            </div>
            <div class="searchRight clearfix">
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check"/></button>
                <button type="button" onclick = "clean()"><spring:message code="common_reset" /></button>
                <button type="button" onclick="popup('900px','584px','${ctx}/bigcargo/consumption/create')"><spring:message code="common_create" /></button>
            </div>
        </div>
    </div>
    
    <input type="hidden" id="tabPageStatus" name="tabPageStatus" value="0"/>
    <div class="tabBox">
        <ul class="clearfix">
            <!-- 全部 -->
            <li class="active" value="0"><spring:message code="bigConsumption_status_all" /></li>
            <!-- 新建 -->
            <li value="1"><spring:message code="bigConsumption_status_create" /></li>
            <!-- 已保存 -->
            <li value="2"><spring:message code="bigConsumption_status_save" /></li>
            <%-- <!-- 已删除 -->
            <li value="3"><spring:message code="bigConsumption_status_delete" /></li> --%>
        </ul>
	</div>
           
            <div class="listBg tabPadding overflowX">
        <div class="tableArea">
            <div class="tableScrollSm" style = "height:650px;overflow: auto;width: 1430px;">
                <table cellpadding="0" class="tableHead" >
                    <thead>
                    <tr>
                        <th><p class="table-No"><spring:message code="bigConsumption_head_no" /></p></th>
                        <th><p class="width-200px"><spring:message code="bigConsumption_head_unitCostNo" /></p></th>
                        <th><p class="width-80px"><spring:message code="bigConsumption_head_stylePictures" /></p></th>
                        <th><p class="width-200px"><spring:message code="bigConsumption_head_no_name" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_styleCategory" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_unitCostMiddleStandard" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_unitCost" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_unitCostRemark" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_status" /></p></th>
                        <th><p class="width-120px"><spring:message code="bigConsumption_head_creater" /></p></th>
                        <th><p class="width-150px"><spring:message code="bigConsumption_head_create_date" /></p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
					<tbody id="listHtml">
					</tbody>
                </table>
            </div>
            </div>
        
    </div>
    <div id="paging"></div>
    </div>
</form>
</body>
</html>